<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

//Route::middleware('auth:api')->get('/user', function (Request $request) {
//    return $request->user();
//});
Route::group(['prefix'=>'{APPID?}'],function ($APPID = 'api'){

    Route::group(['prefix' => 'test'],function() {
        Route::get('checkExcel','Api\ExcelController@checkExcel');
        Route::get('path','Api\ExcelController@test');
    });

    /** 路由可用路由组，但不要使用闭包，闭包无法生成缓存文件 */
    Route::group(['prefix'=>'mall'],function (){
        Route::get('getMerchantList', 'Api\MallController@getMerchantList');
        Route::get('getIndexBannerList', 'Api\MallController@getIndexBannerList');
        Route::get('getIndexButtonList', 'Api\MallController@getIndexButtonList');
        Route::get('getIndexAreaList', 'Api\MallController@getIndexAreaList');
        Route::get('getBuyingClassifyList', 'Api\MallController@getBuyingClassifyList');
        Route::get('getMerchantMedicineList', 'Api\MallController@getMerchantMedicineList');
        Route::get('getMedicineDetail', 'Api\MallController@getMedicineDetail');
        Route::post('addShopCart', 'Api\MallController@addShopCart');
        Route::get('getShopCart', 'Api\MallController@getShopCart');
        Route::post('deleteShopCart', 'Api\MallController@deleteShopCart');
        Route::get('searchMedicine', 'Api\MallController@searchMedicine');
        Route::post('buildOrder', 'Api\MallController@buildOrder');
        Route::post('submitOrder', 'Api\MallController@submitOrder');
        Route::get('getMerchantSupportDeliveryMethod', 'Api\MallController@getMerchantSupportDeliveryMethod');
        Route::get('getFictitiousShopCart', 'Api\MallController@getFictitiousShopCart');
        Route::get('getHelperShopCart', 'Api\MallController@getHelperShopCart');
        Route::post('addHelperShopCart', 'Api\MallController@addHelperShopCart');
        Route::post('deleteHelperShopCart', 'Api\MallController@deleteHelperShopCart');
        Route::post('choiceMedicine', 'Api\MallController@choiceMedicine');
        Route::post('helperShopCartChange', 'Api\MallController@helperShopCartChange');
        Route::get('getRecommendRecord', 'Api\MallController@getRecommendRecord');
        Route::get('getDiseaseList', 'Api\MallController@getDiseaseList');
        Route::get('searchDiseaseList', 'Api\MallController@searchDiseaseList');

    });

    /**
     * Udesk客服接入
     */
    Route::group(['prefix'=>'udesk'],function (){
        //通过微信openid获取用户部分信息
        Route::get('getUserInfoByWxOpenId', 'Api\Udesk\UdeskController@getUserInfoByWxOpenId');
    });

    Route::group(['prefix'=>'order'],function (){
        Route::post('userCancelOrder', 'Api\OrderController@userCancelOrder');
        Route::get('getMyOrderList', 'Api\OrderController@getMyOrderList');
        Route::get('getMyOrderDetail', 'Api\OrderController@getMyOrderDetail');
        Route::post('confirmReceive', 'Api\OrderController@confirmReceive');
        Route::post('prescriptionOrderHandle', 'Api\OrderController@prescriptionOrderHandle');
    });
    Route::group(['prefix'=>'other'],function (){
        Route::get('getOperatingCity', 'Api\OtherController@getOperatingCity');
        Route::get('getIndexMessage', 'Api\OtherController@getIndexMessage');
        Route::any('thirdPartyPlatformAuthHandle', 'Api\OtherController@thirdPartyPlatformAuthHandle');
        Route::any('thirdPartyPlatformMessageHandle/{app_id}', 'Api\OtherController@thirdPartyPlatformMessageHandle');
        Route::any('initMerchant', 'Api\OtherController@initMerchant');
        Route::any('test', 'Api\OtherController@test');
        Route::get('orderOverTime', 'Api\OtherController@orderOverTime');
        Route::get('overTimeConfirmReceive', 'Api\OtherController@overTimeConfirmReceive');
        Route::get('shopCartOverTimeEmpty', 'Api\OtherController@shopCartOverTimeEmpty');

    });

    Route::group(['prefix'=>'auth'],function (){
        Route::any('wxAppLogin', 'Api\AuthController@wxAppLogin');
//        Route::any('wxAppLogin', 'Api\AuthController@wxAppThirdLogin');
        Route::any('wxAppThirdLogin', 'Api\AuthController@wxAppThirdLogin');
        Route::post('sendVerificationCode', 'Api\AuthController@sendVerificationCode');
        Route::post('bindingPhone', 'Api\AuthController@bindingPhone');
//        Route::post('getWeChatPhone', 'Api\AuthController@getWeChatPhone');
        Route::get('getUserToken/{id}', 'Api\AuthController@getUserToken');
        Route::post('getWeChatPhone', 'Api\AuthController@getWeChatPhoneOld');
        Route::post('directBindingPhone', 'Api\AuthController@directBindingPhone');
    });
    Route::group(['prefix' => 'file'],function(){
        Route::post('upload-img',['as'=>'App.File.upload','uses'=>'Api\ImageController@upload']);
        Route::post('upload-excel',['as'=>'App.File.uploadExcel','uses'=>'Api\ImageController@uploadExcel']);
        Route::post('upload-audio',['as'=>'App.File.uploadAudio','uses'=>'Api\ImageController@uploadAudio']);
        Route::post('upload-video',['as'=>'App.File.uploadVideo','uses'=>'Api\ImageController@uploadVideo']);
        Route::post('businessLicenseUpload',['as'=>'App.File.businessLicenseUpload','uses'=>'Api\ImageController@businessLicenseUpload']);
        Route::get('show-image/{id}',['as'=>'App.File.showImageById','uses'=>'Api\ImageController@showImageById']);
        Route::get('show-video/{id}',['as'=>'App.File.showVideoById','uses'=>'Api\ImageController@showVideoById']);
        Route::get('show-excel/{id}',['as'=>'App.File.showExcelById','uses'=>'Api\ImageController@showExcelById']);
        Route::get('reloadImages',['as'=>'App.File.reloadImages','uses'=>'Api\ImageController@reloadImages']);
        Route::post('uploadBase64Image',['as'=>'App.File.uploadBase64Image','uses'=>'Api\ImageController@uploadBase64Image']);
        Route::post('upload-user-photo',['as'=>'App.File.uploadUserPhoto','uses'=>'Api\ImageController@uploadUserPhoto']);
    });
    Route::group(['prefix' => 'coupon'],function(){
        Route::get('getCouponList','Api\CouponController@getCouponList');
        Route::get('getCouponDetail','Api\CouponController@getCouponDetail');
        Route::post('couponReceive','Api\CouponController@couponReceive');

    });
    Route::group(['prefix' => 'ucenter'],function(){
        Route::get('getUserInfo','Api\UCenterController@getUserInfo');
        Route::get('getUserCoupon','Api\UCenterController@getUserCoupon');
        Route::get('getAboutUs','Api\UCenterController@getAboutUs');
        Route::post('newShippingAddress','Api\UCenterController@newShippingAddress');
        Route::get('getShippingAddress','Api\UCenterController@getShippingAddress');
        Route::post('deleteShippingAddress','Api\UCenterController@deleteShippingAddress');
        Route::get('getUserDrugList','Api\UCenterController@getUserDrugList');
        Route::get('getUserDrugDetail','Api\UCenterController@getUserDrugDetail');
        Route::post('setUserDrug','Api\UCenterController@setUserDrug');
        Route::post('delUserDrug','Api\UCenterController@delUserDrug');


    });

    Route::group(['prefix' => 'merchant'],function() {
        Route::middleware('permission:merchant_select')->get('getMerchantList', 'Api\Merchant\MerchantController@getMerchantList');
        Route::middleware('permission:merchant_select')->get('getMerchantDetail', 'Api\Merchant\MerchantController@getMerchantDetail');
        Route::middleware('permission:merchant_edit')->post('setMerchant', 'Api\Merchant\MerchantController@setMerchant');
        Route::middleware('permission:merchant_delete')->post('delMerchant', 'Api\Merchant\MerchantController@delMerchant');
        Route::middleware('permission:merchant_edit')->post('changeMerchantStatus', 'Api\Merchant\MerchantController@changeMerchantStatus');
        Route::middleware('permission:merchant_edit')->post('setMerchantDeliveryMethod', 'Api\Merchant\MerchantController@setMerchantDeliveryMethod');
        Route::middleware('permission:goods_classify_select')->get('getGoodsClassifyList', 'Api\Merchant\MerchantController@getGoodsClassifyList');
        Route::middleware('permission:goods_classify_select')->get('getGoodsClassifyDetail', 'Api\Merchant\MerchantController@getGoodsClassifyDetail');
        Route::middleware('permission:goods_classify_edit')->post('setGoodsClassify', 'Api\Merchant\MerchantController@setGoodsClassify');
        Route::middleware('permission:goods_classify_delete')->post('delGoodsClassify', 'Api\Merchant\MerchantController@delGoodsClassify');
        Route::middleware('permission:merchant_staff_select')->get('getMerchantStaffList', 'Api\Merchant\MerchantController@getMerchantStaffList');
        Route::middleware('permission:merchant_staff_select')->get('getMerchantStaffDetail', 'Api\Merchant\MerchantController@getMerchantStaffDetail');
        Route::middleware('permission:merchant_staff_edit')->post('setMerchantStaff', 'Api\Merchant\MerchantController@setMerchantStaff');
        Route::middleware('permission:merchant_staff_delete')->post('delMerchantStaff', 'Api\Merchant\MerchantController@delMerchantStaff');
        Route::get('getMerchantQrCode', 'Api\Merchant\MerchantController@getMerchantQrCode');

        //批量设置商品主图，数据处理模块
        Route::get('setMerchantMedicineImg', 'Api\Merchant\DataHandleController@setMerchantMedicineImg');

        Route::group(['prefix' => 'auth'],function() {
            Route::post('signUp', 'Api\Merchant\AuthController@signUp');
            Route::get('usernameVerify', 'Api\Merchant\AuthController@usernameVerify');
            Route::post('enterpriseReview', 'Api\Merchant\AuthController@enterpriseReview');
            Route::post('signIn', 'Api\Merchant\AuthController@signIn');
            Route::post('changePassword', 'Api\Merchant\AuthController@changePassword');
            Route::any('loginOut', 'Api\Merchant\AuthController@loginOut');
            Route::get('getMerchantUserInfo', 'Api\Merchant\AuthController@getMerchantUserInfo');
            Route::middleware('permission:admin_select')->get('adminList', 'Api\Merchant\AuthController@adminList');
            Route::middleware('permission:admin_select')->get('adminSet', 'Api\Merchant\AuthController@adminSet');
            Route::middleware('permission:admin_edit')->post('changeAdminStatus', 'Api\Merchant\AuthController@changeAdminStatus');
            Route::middleware('permission:admin_edit')->post('setAdmin', 'Api\Merchant\AuthController@setAdmin');
            Route::middleware('permission:admin_delete')->post('delAdmin', 'Api\Merchant\AuthController@delAdmin');
            Route::middleware('permission:role_select')->get('roleList', 'Api\Merchant\AuthController@roleList');
            Route::middleware('permission:role_select')->get('roleSet', 'Api\Merchant\AuthController@roleSet');
            Route::middleware('permission:role_edit')->post('setRole', 'Api\Merchant\AuthController@setRole');
            Route::middleware('permission:role_delete')->post('delRole', 'Api\Merchant\AuthController@delRole');
            Route::middleware('permission:permission_select')->get('permissionsList', 'Api\Merchant\AuthController@permissionsList');
            Route::post('setWxappPayment', 'Api\Merchant\AuthController@setWxappPayment');
            Route::get('getEnterpriseReviewStatus', 'Api\Merchant\AuthController@getEnterpriseReviewStatus');
            Route::get('getWxappPayment', 'Api\Merchant\AuthController@getWxappPayment');

        });

        Route::group(['prefix' => 'goods'],function() {
            Route::middleware('permission:goods_select')->get('getGoodsList', 'Api\Merchant\GoodsController@getGoodsList');
            Route::middleware('permission:goods_select')->get('getGoodsDetail', 'Api\Merchant\GoodsController@getGoodsDetail');
            Route::middleware('permission:goods_select')->get('getGoodsClassify', 'Api\Merchant\GoodsController@getGoodsClassify');
            Route::middleware('permission:goods_select')->get('getGoodsSkuList', 'Api\Merchant\GoodsController@getGoodsSkuList');
            Route::middleware('permission:goods_edit')->post('setGoods', 'Api\Merchant\GoodsController@setGoods');
            Route::middleware('permission:goods_delete')->post('delGoods', 'Api\Merchant\GoodsController@delGoods');
            Route::middleware('permission:goods_edit')->post('changeGoodsShop', 'Api\Merchant\GoodsController@changeGoodsShop');
            Route::get('getSystemMedicineByUpc', 'Api\Merchant\GoodsController@getSystemMedicineByUpc');
            Route::get('getGoodsSpuList', 'Api\Merchant\GoodsController@getGoodsSpuList');
            Route::get('getGoodsSpuDetail', 'Api\Merchant\GoodsController@getGoodsSpuDetail');
            Route::post('setGoodsSpu', 'Api\Merchant\GoodsController@setGoodsSpu');
            Route::post('delGoodsSpu', 'Api\Merchant\GoodsController@delGoodsSpu');
            Route::middleware('permission:goods_apply_select')->get('getGoodsApplyList', 'Api\Merchant\GoodsController@getGoodsApplyList');
            Route::middleware('permission:goods_apply_select')->get('getGoodsApplyDetail', 'Api\Merchant\GoodsController@getGoodsApplyDetail');
            Route::post('setDiscountSalesRule', 'Api\Merchant\GoodsController@setDiscountSalesRule');
            Route::post('delDiscountSalesRule', 'Api\Merchant\GoodsController@delDiscountSalesRule');
            Route::post('setDiscountSalesXMedicine', 'Api\Merchant\GoodsController@setDiscountSalesXMedicine');
            Route::get('getDiscountSalesRule', 'Api\Merchant\GoodsController@getDiscountSalesRule');
            Route::post('changeDiscountSalesRuleStatus', 'Api\Merchant\GoodsController@changeDiscountSalesRuleStatus');
            Route::get('getSystemMedicineUpcList', 'Api\Merchant\GoodsController@getSystemMedicineUpcList');
            Route::get('selectGoodsExists', 'Api\Merchant\GoodsController@selectGoodsExists');
            Route::post('importGoods', 'Api\Merchant\GoodsController@importGoods');
            Route::post('importGoodsNew', 'Api\Merchant\GoodsController@importGoodsNew');
            Route::get('imgOss', 'Api\Merchant\GoodsController@imgOss');
            Route::get('getImgUrlInfo', 'Api\Merchant\GoodsController@getImgUrlInfo');

        });

        Route::group(['prefix' => 'wxapp'],function() {
            Route::middleware('permission:banner_select')->get('getBannerList', 'Api\Merchant\WxAppController@getBannerList');
            Route::middleware('permission:banner_select')->get('getBannerDetail', 'Api\Merchant\WxAppController@getBannerDetail');
            Route::middleware('permission:banner_edit')->post('setBanner', 'Api\Merchant\WxAppController@setBanner');
            Route::middleware('permission:banner_delete')->post('delBanner', 'Api\Merchant\WxAppController@delBanner');
            Route::middleware('permission:button_select')->get('getButtonList', 'Api\Merchant\WxAppController@getButtonList');
            Route::middleware('permission:button_select')->get('getButtonDetail', 'Api\Merchant\WxAppController@getButtonDetail');
            Route::middleware('permission:button_edit')->post('setButton', 'Api\Merchant\WxAppController@setButton');
            Route::middleware('permission:button_delete')->post('delButton', 'Api\Merchant\WxAppController@delButton');
            Route::middleware('permission:area_select')->get('getMerchantMedicineAreaList', 'Api\Merchant\WxAppController@getMerchantMedicineAreaList');
            Route::middleware('permission:area_select')->get('getMerchantMedicineAreaDetail', 'Api\Merchant\WxAppController@getMerchantMedicineAreaDetail');
            Route::middleware('permission:area_edit')->post('setMerchantMedicineArea', 'Api\Merchant\WxAppController@setMerchantMedicineArea');
            Route::middleware('permission:area_delete')->post('delMerchantMedicineArea', 'Api\Merchant\WxAppController@delMerchantMedicineArea');
            Route::middleware('permission:area_edit')->get('getMerchantMedicineXAreaList', 'Api\Merchant\WxAppController@getMerchantMedicineXAreaList');
            Route::middleware('permission:area_edit')->post('setMerchantMedicineXArea', 'Api\Merchant\WxAppController@setMerchantMedicineXArea');
            Route::middleware('permission:area_edit')->post('delMerchantMedicineXArea', 'Api\Merchant\WxAppController@delMerchantMedicineXArea');
            Route::middleware('permission:about_us_select')->get('getAboutUs', 'Api\Merchant\WxAppController@getAboutUs');
            Route::middleware('permission:about_us_edit')->post('setAboutUs', 'Api\Merchant\WxAppController@setAboutUs');
        });

        Route::group(['prefix' => 'order'],function() {
            Route::middleware('permission:order_select')->get('getOrderList', 'Api\Merchant\OrderController@getOrderList');
            Route::middleware('permission:order_select')->get('getOrderDetail', 'Api\Merchant\OrderController@getOrderDetail');
            Route::middleware('permission:order_edit')->post('setOrderShipInfo', 'Api\Merchant\OrderController@setOrderShipInfo');
            Route::middleware('permission:order_edit')->post('cancelOrder', 'Api\Merchant\OrderController@cancelOrder');
            Route::post('setOrderPrescriptionInfo', 'Api\Merchant\OrderController@setOrderPrescriptionInfo');
            Route::post('confirmReceive', 'Api\Merchant\OrderController@confirmReceive');
            Route::get('orderExport', 'Api\Merchant\OrderController@orderExport');
            Route::post('orderRefund', 'Api\Merchant\OrderController@orderRefund');
            Route::get('getOrderRefundRecord', ['as' => 'Api.Order.getOrderRefundRecord','uses' => 'Api\Merchant\OrderController@getOrderRefundRecord']);
            Route::get('orderRefundResult', ['as' => 'Api.Order.orderRefundResult','uses' => 'Api\Merchant\OrderController@orderRefundResult']);
            Route::get('lookOverRefundResult', ['as' => 'Api.Order.lookOverRefundResult','uses' => 'Api\Merchant\OrderController@lookOverRefundResult']);
            Route::get('pharmacistRecommendMedicineList', ['as' => 'Api.Order.pharmacistRecommendMedicineList','uses' => 'Api\Merchant\OrderController@pharmacistRecommendMedicineList']);
            Route::any('prescriptionCallbackStatus', ['as' => 'Api.Order.prescriptionCallbackStatus','uses' => 'Api\Merchant\OrderController@prescriptionCallbackStatus']);

        });

        Route::group(['prefix' => 'user'],function() {
            Route::middleware('permission:enterprise_user_select')->get('getUserList', 'Api\Merchant\UserController@getUserList');
            Route::middleware('permission:enterprise_user_select')->get('getUserDetail', 'Api\Merchant\UserController@getUserDetail');

        });

        Route::group(['prefix' => 'coupon'],function() {
            Route::get('getCouponList', 'Api\Merchant\CouponController@getCouponList');
            Route::get('getCouponDetail', 'Api\Merchant\CouponController@getCouponDetail');
            Route::post('setCoupon', 'Api\Merchant\CouponController@setCoupon');
            Route::post('delCoupon', 'Api\Merchant\CouponController@delCoupon');
        });

        Route::group(['prefix' => 'data'],function() {
            Route::middleware('permission:money_change_select')->get('getEnterpriseMoneyChange', 'Api\Merchant\DataController@getEnterpriseMoneyChange');
            Route::middleware('permission:data_summary_select')->get('getEnterpriseDataSummary', 'Api\Merchant\DataController@getEnterpriseDataSummary');
            Route::get('getClassifySelling','Api\Merchant\DataController@getClassifySelling');
            Route::get('getMerchantSelling','Api\Merchant\DataController@getMerchantSelling');
            Route::get('getReBuyRate','Api\Merchant\DataController@getReBuyRate');
            Route::get('getOrderCounts','Api\Merchant\DataController@getOrderCounts');
            Route::get('enterpriseMoneyExport','Api\Merchant\DataController@enterpriseMoneyExport');
            Route::get('getUnreadNum','Api\Merchant\DataController@getUnreadNum');
            Route::get('getMessageList','Api\Merchant\DataController@getMessageList');
            Route::post('setMessageAlreadyRead','Api\Merchant\DataController@setMessageAlreadyRead');
            Route::get('exportMedicine','Api\Merchant\DataController@exportMedicine');
        });
        Route::group(['prefix'=>'meituan'],function (){
            Route::any('sendToMeituan','Api\Merchant\MeituanController@sendToMeituan');
            Route::any('cancelMeituanOrder','Api\Merchant\MeituanController@cancelMeituanOrder');
            Route::any('checkMeituanOrder','Api\Merchant\MeituanController@checkMeituanOrder');
            //callback
            Route::post('orderStatusCallback','Api\Merchant\MeituanController@orderStatusCallback');
            Route::post('orderExceptionCallback','Api\Merchant\MeituanController@orderExceptionCallback');
            Route::post('deliveryAreaChangeCallback','Api\Merchant\MeituanController@deliveryAreaChangeCallback');
            Route::post('deliveryRiskChangeCallback','Api\Merchant\MeituanController@deliveryRiskChangeCallback');
            Route::post('merchantStatusChangeCallback','Api\Merchant\MeituanController@merchantStatusChangeCallback');
            Route::post('deliveryPersonDutyChangeCallback','Api\Merchant\MeituanController@deliveryPersonDutyChangeCallback');
        });


        Route::middleware('permission:check_authorize_status')->get('checkAuthorizeStatus','Api\WeChatThirdController@checkAuthorizeStatus');
        Route::middleware('permission:authorize_info_select')->get('checkAuthorizeInfo','Api\WeChatThirdController@checkAuthorizeInfo');


    });

    Route::group(['prefix' => 'excel'],function() {
        Route::get('checkExcel','Api\ExcelController@checkExcel');
        Route::post('setMessageAlreadyRead','Api\Merchant\DataController@setMessageAlreadyRead');
    });

    Route::group(['prefix'=>'admin'],function (){
        Route::get('getOrderList', 'Api\Admin\OrderController@getOrderList');
        Route::get('getOrderDetail', 'Api\Admin\OrderController@getOrderDetail');
        Route::post('dispatchOrderToDriver', 'Api\Admin\OrderController@dispatchOrderToDriver');
        Route::post('changeOrderDriver', 'Api\Admin\OrderController@changeOrderDriver');
        Route::get('getCancelOrderApply', 'Api\Admin\OrderController@getCancelOrderApply');
        Route::post('setCancelOrderStatus', 'Api\Admin\OrderController@setCancelOrderStatus');

        Route::post('signInUser', 'Api\Admin\AuthController@signInUser');
        Route::post('changePassword', 'Api\Admin\AuthController@changePassword');
        Route::any('loginOut', 'Api\Admin\AuthController@loginOut');
        Route::get('getAdminUserInfo', 'Api\Admin\AuthController@getAdminUserInfo');
        Route::get('getMyPermission', 'Api\Admin\AuthController@getMyPermission');
        //TODO
        Route::middleware('admin_permission:admin_operating')->get('adminList', 'Api\Admin\AuthController@adminList');
        Route::middleware('admin_permission:admin_operating')->get('adminSet', 'Api\Admin\AuthController@adminSet');
        Route::middleware('admin_permission:admin_operating')->post('changeAdminStatus', 'Api\Admin\AuthController@changeAdminStatus');
        Route::middleware('admin_permission:admin_operating')->post('setAdmin', 'Api\Admin\AuthController@setAdmin');
        Route::middleware('admin_permission:admin_operating')->post('delAdmin', 'Api\Admin\AuthController@delAdmin');
        Route::middleware('admin_permission:admin_operating')->get('roleList', 'Api\Admin\AuthController@roleList');
        Route::middleware('admin_permission:admin_operating')->get('roleSet', 'Api\Admin\AuthController@roleSet');
        Route::middleware('admin_permission:admin_operating')->post('setRole', 'Api\Admin\AuthController@setRole');
        Route::middleware('admin_permission:admin_operating')->post('delRole', 'Api\Admin\AuthController@delRole');
        Route::middleware('admin_permission:admin_operating')->get('permissionsList', 'Api\Admin\AuthController@permissionsList');
        Route::middleware('admin_permission:admin_operating')->get('permissionsSet', 'Api\Admin\AuthController@permissionsSet');
        Route::middleware('admin_permission:admin_operating')->post('setPermissions', 'Api\Admin\AuthController@setPermissions');
        Route::middleware('admin_permission:admin_operating')->post('delPermissions', 'Api\Admin\AuthController@delPermissions');

        //商家管理
        Route::middleware('admin_permission:admin_enterprise_select')->get('getEnterpriseList', 'Api\Admin\EnterpriseController@getEnterpriseList');
        Route::middleware('admin_permission:admin_enterprise_select')->get('getEnterpriseDetail', 'Api\Admin\EnterpriseController@getEnterpriseDetail');
        Route::middleware('admin_permission:admin_enterprise_edit')->post('setEnterprise', 'Api\Admin\EnterpriseController@setEnterprise');
        Route::middleware('admin_permission:admin_enterprise_edit')->post('changeEnterpriseStatus', 'Api\Admin\EnterpriseController@changeEnterpriseStatus');
        Route::middleware('admin_permission:admin_enterprise_delete')->post('delEnterprise', 'Api\Admin\EnterpriseController@delEnterprise');
        Route::middleware('admin_permission:admin_enterprise_apply_select')->get('getEnterpriseApplyList', 'Api\Admin\EnterpriseController@getEnterpriseApplyList');
        Route::middleware('admin_permission:admin_enterprise_apply_select')->get('getEnterpriseApplyDetail', 'Api\Admin\EnterpriseController@getEnterpriseApplyDetail');
        Route::middleware('admin_permission:admin_enterprise_review')->post('enterpriseReview', 'Api\Admin\EnterpriseController@enterpriseReview');

        //商品管理
        Route::middleware('admin_permission:admin_goods_select')->get('getGoodsList', 'Api\Admin\GoodsController@getGoodsList');
        Route::middleware('admin_permission:admin_goods_select')->get('getGoodsDetail', 'Api\Admin\GoodsController@getGoodsDetail');
        Route::middleware('admin_permission:admin_goods_edit')->post('setGoods', 'Api\Admin\GoodsController@setGoods');
        Route::middleware('admin_permission:admin_goods_edit')->post('changeGoodsShop', 'Api\Admin\GoodsController@changeGoodsShop');
        Route::middleware('admin_permission:admin_goods_delete')->post('delGoods', 'Api\Admin\GoodsController@delGoods');
        Route::middleware('admin_permission:admin_goods_apply_select')->get('getGoodsApplyList', 'Api\Admin\GoodsController@getGoodsApplyList');
        Route::middleware('admin_permission:admin_goods_apply_select')->get('getGoodsApplyDetail', 'Api\Admin\GoodsController@getGoodsApplyDetail');
        Route::middleware('admin_permission:admin_goods_review')->post('setGoodsApply', 'Api\Admin\GoodsController@setGoodsApply');
        Route::middleware('admin_permission:admin_goods_review')->post('goodsReview', 'Api\Admin\GoodsController@goodsReview');
        Route::middleware('admin_permission:admin_goods_classify_select')->get('getGoodsClassifyList', 'Api\Admin\GoodsController@getGoodsClassifyList');
        Route::middleware('admin_permission:admin_goods_classify_select')->get('getGoodsClassifyDetail', 'Api\Admin\GoodsController@getGoodsClassifyDetail');
        Route::middleware('admin_permission:admin_goods_classify_edit')->post('setGoodsClassify', 'Api\Admin\GoodsController@setGoodsClassify');
        Route::middleware('admin_permission:admin_goods_classify_delete')->post('delGoodsClassify', 'Api\Admin\GoodsController@delGoodsClassify');
        Route::get('enterGoods', 'Api\Admin\GoodsController@enterGoods');
        Route::get('enterGoodsTwo', 'Api\Admin\GoodsController@enterGoodsTwo');

        //规格管理
        Route::get('getSkuList', 'Api\Admin\GoodsController@getSkuList');
        Route::get('getSkuDetail', 'Api\Admin\GoodsController@getSkuDetail');
        Route::post('setSku', 'Api\Admin\GoodsController@setSku');
        Route::post('delSku', 'Api\Admin\GoodsController@delSku');
        Route::get('skuValueList', 'Api\Admin\GoodsController@skuValueList');
        Route::get('skuValueDetail', 'Api\Admin\GoodsController@skuValueDetail');
        Route::post('setSkuValue', 'Api\Admin\GoodsController@setSkuValue');
        Route::post('delSkuValue', 'Api\Admin\GoodsController@delSkuValue');


        Route::post('setAboutUs', 'Api\Admin\SystemController@setAboutUs');
        Route::get('getPetsWeightList', 'Api\Admin\SystemController@getPetsWeightList');
        Route::get('getPetsWeightDetail', 'Api\Admin\SystemController@getPetsWeightDetail');

        //TODO
        Route::post('changePetsWeightStatus', 'Api\Admin\SystemController@changePetsWeightStatus');
        Route::post('setPetsWeight', 'Api\Admin\SystemController@setPetsWeight');
        Route::post('delPetsWeight', 'Api\Admin\SystemController@delPetsWeight');
        Route::get('getIndexMessage', 'Api\Admin\SystemController@getIndexMessage');
        Route::post('setIndexMessage', 'Api\Admin\SystemController@setIndexMessage');
        Route::get('getOperatingCityList', 'Api\Admin\SystemController@getOperatingCityList');
        Route::get('operatingCityDetail', 'Api\Admin\SystemController@operatingCityDetail');
        //TODO
        Route::post('changeOperatingCityStatus', 'Api\Admin\SystemController@changeOperatingCityStatus');
        Route::post('setOperatingCity', 'Api\Admin\SystemController@setOperatingCity');
        Route::post('delOperatingCity', 'Api\Admin\SystemController@delOperatingCity');
        Route::get('getFeeRule', 'Api\Admin\SystemController@getFeeRule');
        Route::post('setFeeRule', 'Api\Admin\SystemController@setFeeRule');
        Route::get('getFeeDetail', 'Api\Admin\SystemController@getFeeDetail');
        Route::post('setFeeDetail', 'Api\Admin\SystemController@setFeeDetail');

        Route::get('getDriverList', 'Api\Admin\DriverController@getDriverList');
        Route::get('getDriverDetail', 'Api\Admin\DriverController@getDriverDetail');
        //TODO
        Route::post('changeDriverStatus', 'Api\Admin\DriverController@changeDriverStatus');
        Route::post('setDriver', 'Api\Admin\DriverController@setDriver');
        Route::post('delDriver', 'Api\Admin\DriverController@delDriver');
        Route::get('getCarsList', 'Api\Admin\DriverController@getCarsList');
        Route::get('getCarsDetail', 'Api\Admin\DriverController@getCarsDetail');
        Route::post('setCars', 'Api\Admin\DriverController@setCars');
        Route::post('delCars', 'Api\Admin\DriverController@delCars');
        Route::get('getDriverBindCarsList', 'Api\Admin\DriverController@getDriverBindCarsList');
        Route::post('setDriverBindCar', 'Api\Admin\DriverController@setDriverBindCar');
        Route::post('delDriverBindCar', 'Api\Admin\DriverController@delDriverBindCar');
        Route::post('defaultDriverBindCar', 'Api\Admin\DriverController@defaultDriverBindCar');

        //第三方平台操作接口
        //获取授权小程序的基本信息
        Route::get('getMiniProgramAccountBasicInfo', 'Api\Admin\PlatformController@getMiniProgramAccountBasicInfo');
        Route::post('setDomain', 'Api\Admin\PlatformController@setDomain');
        Route::post('setWebViewDomain', 'Api\Admin\PlatformController@setWebViewDomain');
        Route::post('setNickname', 'Api\Admin\PlatformController@setNickname');
        Route::get('checkVerifyNickname', 'Api\Admin\PlatformController@checkVerifyNickname');
        Route::get('getNicknameSettingStatus', 'Api\Admin\PlatformController@getNicknameSettingStatus');
        Route::post('setHeadImage', 'Api\Admin\PlatformController@setHeadImage');

        Route::post('bindExperiencer', 'Api\Admin\PlatformController@bindExperiencer');
        Route::post('unbindExperiencer', 'Api\Admin\PlatformController@unbindExperiencer');
        Route::get('getBindExperiencer', 'Api\Admin\PlatformController@getBindExperiencer');

        Route::get('getTemplateDraftList', 'Api\Admin\PlatformController@getTemplateDraftList');
        Route::post('addToTemplate', 'Api\Admin\PlatformController@addToTemplate');
        Route::get('getTemplateList', 'Api\Admin\PlatformController@getTemplateList');
        Route::post('delTemplate', 'Api\Admin\PlatformController@delTemplate');
        Route::post('uploadMiniProgramCode', 'Api\Admin\PlatformController@uploadMiniProgramCode');
        Route::get('getUploadPageList', 'Api\Admin\PlatformController@getUploadPageList');
        Route::get('getExperienceQRCode', 'Api\Admin\PlatformController@getExperienceQRCode');
        Route::post('submitCodeToReview', 'Api\Admin\PlatformController@submitCodeToReview');
        Route::post('publicMiniProgram', 'Api\Admin\PlatformController@publicMiniProgram');
        Route::get('getReviewStatus', 'Api\Admin\PlatformController@getReviewStatus');

        Route::middleware('admin_permission:admin_platform_config')->post('setPlatformConfig', 'Api\Admin\PlatformController@setPlatformConfig');
        Route::middleware('admin_permission:admin_platform_config')->get('getPlatformConfig', 'Api\Admin\PlatformController@getPlatformConfig');

        //操作类
        Route::post('bindDomain', 'Api\Admin\PlatformController@bindDomain');
        Route::get('getBindConfig', 'Api\Admin\PlatformController@getBindConfig');
        //获取类
        Route::middleware('admin_permission:admin_authorizer_select')->get('getAuthorizerList', 'Api\Admin\PlatformController@getAuthorizerList');

        Route::middleware('admin_permission:admin_data_summary')->get('getDataSummary', 'Api\Admin\LookController@getDataSummary');
        Route::middleware('admin_permission:admin_user_select')->get('getUserList', 'Api\Admin\LookController@getUserList');
        Route::get('getMedicineList', 'Api\Admin\LookController@getMedicineList');
        Route::middleware('admin_permission:admin_data_summary')->get('getMerchantLeaderBoard', 'Api\Admin\LookController@getMerchantLeaderBoard');
        Route::middleware('admin_permission:admin_data_summary')->get('getEnterpriseLeaderBoard', 'Api\Admin\LookController@getEnterpriseLeaderBoard');
    });
    Route::group(['prefix'=>'payment'],function (){
        Route::post('weChatPayment',['as'=>'App.Payment.weChatPayment','uses'=>'Api\PaymentController@weChatPayment']);
        Route::get('getPayQrCode',['as'=>'App.Payment.getPayQrCode','uses'=>'Api\PaymentController@getPayQrCode']);
        Route::get('getPayStatus',['as'=>'App.Payment.getPayStatus','uses'=>'Api\PaymentController@getPayStatus']);
        Route::any('WeChatPayCallback',['as'=>'App.Payment.WeChatPayCallback','uses'=>'Api\PaymentController@WeChatPayCallback']);
        Route::post('prescriptionApply',['as'=>'App.Payment.prescriptionApply','uses'=>'Api\PaymentController@prescriptionApply']);
        Route::post('drugstoreLogin',['as'=>'App.Payment.drugstoreLogin','uses'=>'Api\PaymentController@drugstoreLogin']);
        Route::get('getDoctorList',['as'=>'App.Payment.getDoctorList','uses'=>'Api\PaymentController@getDoctorList']);

    });
    Route::group(['prefix'=>'wechatthird'],function (){
        Route::get('getPreAuthorizationUrl',['as'=>'App.WeChatThird.getPreAuthorizationUrl','uses'=>'Api\WeChatThirdController@getPreAuthorizationUrl']);
        Route::get('getPreAuthorizationPage',['as'=>'App.WeChatThird.getPreAuthorizationPage','uses'=>'Api\WeChatThirdController@getPreAuthorizationPage']);
        Route::get('getPreAuthorizationView',['as'=>'App.WeChatThird.getPreAuthorizationView','uses'=>'Api\WeChatThirdController@getPreAuthorizationView']);
        Route::any('AuthorizationRedirectUri',['as'=>'App.WeChatThird.AuthorizationRedirectUri','uses'=>'Api\WeChatThirdController@AuthorizationRedirectUri']);
        Route::post('uploadCert',['as'=>'App.WeChatThird.uploadCert','uses'=>'Api\WeChatThirdController@uploadCert']);
        Route::post('uploadKey',['as'=>'App.WeChatThird.uploadKey','uses'=>'Api\WeChatThirdController@uploadKey']);
        Route::post('setWechatPayConfig',['as'=>'App.WeChatThird.setWechatPayConfig','uses'=>'Api\WeChatThirdController@setWechatPayConfig']);
        Route::get('getWechatPayConfig',['as'=>'App.WeChatThird.getWechatPayConfig','uses'=>'Api\WeChatThirdController@getWechatPayConfig']);
    });
    Route::get('change','\App\Http\Controllers\Api\Admin\GoodsController@change');




});

Route::group(['prefix'=>'api'],function (){
    Route::group(['prefix'=>'wechatthird'],function (){
        Route::get('getPreAuthorizationUrl',['as'=>'Api.WeChatThird.getPreAuthorizationUrl','uses'=>'Api\WeChatThirdController@getPreAuthorizationUrl']);
        Route::get('getPreAuthorizationPage',['as'=>'Api.WeChatThird.getPreAuthorizationPage','uses'=>'Api\WeChatThirdController@getPreAuthorizationPage']);
        Route::get('getPreAuthorizationView',['as'=>'Api.WeChatThird.getPreAuthorizationView','uses'=>'Api\WeChatThirdController@getPreAuthorizationView']);
        Route::any('AuthorizationRedirectUri',['as'=>'Api.WeChatThird.AuthorizationRedirectUri','uses'=>'Api\WeChatThirdController@AuthorizationRedirectUri']);
        Route::post('uploadCert',['as'=>'Api.WeChatThird.uploadCert','uses'=>'Api\WeChatThirdController@uploadCert']);
        Route::post('uploadKey',['as'=>'Api.WeChatThird.uploadKey','uses'=>'Api\WeChatThirdController@uploadKey']);
        Route::post('setWechatPayConfig',['as'=>'Api.WeChatThird.setWechatPayConfig','uses'=>'Api\WeChatThirdController@setWechatPayConfig']);
        Route::get('getWechatPayConfig',['as'=>'Api.WeChatThird.getWechatPayConfig','uses'=>'Api\WeChatThirdController@getWechatPayConfig']);
    });
    Route::group(['prefix' => 'file'],function(){
        Route::post('upload-img',['as'=>'Api.File.upload','uses'=>'Api\ImageController@upload']);
        Route::post('upload-excel',['as'=>'Api.File.uploadExcel','uses'=>'Api\ImageController@uploadExcel']);
        Route::post('upload-audio',['as'=>'Api.File.uploadAudio','uses'=>'Api\ImageController@uploadAudio']);
        Route::post('upload-video',['as'=>'Api.File.uploadVideo','uses'=>'Api\ImageController@uploadVideo']);
        Route::post('businessLicenseUpload',['as'=>'Api.File.businessLicenseUpload','uses'=>'Api\ImageController@businessLicenseUpload']);
        Route::get('show-image/{id}',['as'=>'Api.File.showImageById','uses'=>'Api\ImageController@showImageById']);
        Route::get('show-video/{id}',['as'=>'Api.File.showVideoById','uses'=>'Api\ImageController@showVideoById']);
        Route::get('show-excel/{id}',['as'=>'Api.File.showExcelById','uses'=>'Api\ImageController@showExcelById']);
        Route::get('reloadImages',['as'=>'Api.File.reloadImages','uses'=>'Api\ImageController@reloadImages']);
        Route::post('uploadBase64Image',['as'=>'Api.File.uploadBase64Image','uses'=>'Api\ImageController@uploadBase64Image']);
        Route::post('upload-user-photo',['as'=>'Api.File.uploadUserPhoto','uses'=>'Api\ImageController@uploadUserPhoto']);
    });
    Route::group(['prefix' => 'excel'],function(){
        Route::post('uploadExcel',['as'=>'Api.Excel.uploadExcel','uses'=>'Api\ExcelController@uploadExcel']);
        Route::post('checkExcel',['as'=>'Api.Excel.checkExcel','uses'=>'Api\ExcelController@checkExcel']);
        Route::post('confirmImportStandardMedicine',['as'=>'Api.Excel.confirmImportStandardMedicine','uses'=>'Api\ExcelController@confirmImportStandardMedicine']);
        Route::get('getImportStatus',['as'=>'Api.Excel.getImportStatus','uses'=>'Api\ExcelController@getImportStatus']);
    });
    Route::group(['prefix'=>'payment'],function (){
        Route::post('weChatPayment',['as'=>'Api.Payment.weChatPayment','uses'=>'Api\PaymentController@weChatPayment']);
        Route::get('getPayQrCode',['as'=>'Api.Payment.getPayQrCode','uses'=>'Api\PaymentController@getPayQrCode']);
        Route::get('getPayStatus',['as'=>'Api.Payment.getPayStatus','uses'=>'Api\PaymentController@getPayStatus']);
        Route::any('WeChatPayCallback',['as'=>'Api.Payment.WeChatPayCallback','uses'=>'Api\PaymentController@WeChatPayCallback']);
    });
    Route::group(['prefix'=>'distribution'],function (){
        Route::post('setDistributionRule','Api\Distribution\DistributionController@setDistributionRule');
        Route::post('setCommonValue','Api\Distribution\DistributionController@setCommonValue');
        Route::get('getCommonValue','Api\Distribution\DistributionController@getCommonValue');
        Route::get('getDistributionUserList','Api\Distribution\DistributionController@getDistributionUserList');
        Route::get('getDistributionNextUser','Api\Distribution\DistributionController@getDistributionNextUser');
        Route::get('getDistributionReviewList','Api\Distribution\DistributionController@getDistributionReviewList');
        Route::get('reviewDistributionApplication','Api\Distribution\DistributionController@reviewDistributionApplication');
        Route::get('getUserRebate','Api\Distribution\DistributionController@getUserRebate');
        Route::get('getDistributionRule','Api\Distribution\DistributionController@getDistributionRule');
        Route::post('setDistributionSignedUser','Api\Distribution\DistributionController@setDistributionSignedUser');
        Route::get('getWithdrawsList','Api\Distribution\DistributionController@getWithdrawsList');
        Route::post('reviewWithdrawsList','Api\Distribution\DistributionController@reviewWithdrawsList');

        //测试企业支付零钱
        Route::get('setWithdrawalOrder','Api\Distribution\PaymentController@setWithdrawalOrder');

        //获取用户分享海报图接口，小程序对接
        Route::get('getShareImg','Api\DistributionController@getShareImg');
        //获取用户分销统计相关接口，小程序对接
        Route::get('getUserDistributionInfo','Api\DistributionController@getUserDistributionInfo');
        //申请提现接口，小程序对接
        Route::post('applyWithdrawal','Api\DistributionController@applyWithdrawal');
        //获取我的团队列表接口，小程序对接
        Route::get('getUserTeamsList','Api\DistributionController@getUserTeamsList');
    });
});
